$OpenBSD: patch-CMakeLists_txt,v 1.2 2013/06/23 17:51:31 dcoppa Exp $
--- CMakeLists.txt.orig	Wed Jul 22 07:54:28 2009
+++ CMakeLists.txt	Sun Jun 23 19:16:54 2013
@@ -21,7 +21,7 @@ MESSAGE("Open Sonic version ${GAME_VERSION}")
 
 # configuring...
 SET(DEFS "")
-SET(CFLAGS "")
+SET(CFLAGS "$ENV{OPENSNC_ALLEGRO_CFLAGS}")
 
 IF(UNIX)
   SET(ALLEGRO_UNIX_LIBS "$ENV{OPENSNC_ALLEGRO_LIBS}")
@@ -164,8 +164,8 @@ IF(UNIX)
   SET_TARGET_PROPERTIES(${GAME_BIN} PROPERTIES LINK_FLAGS ${ALLEGRO_UNIX_LIBS})
   TARGET_LINK_LIBRARIES(${GAME_BIN} m ${LOGG_LIBS} ${DUMB_LIBS} alpng)
   SET_TARGET_PROPERTIES(${LAUNCHER_BIN} PROPERTIES LINK_FLAGS ${ALLEGRO_UNIX_LIBS})
-  SET_TARGET_PROPERTIES(${GAME_BIN} PROPERTIES COMPILE_FLAGS "-Wall -O2 ${CFLAGS}")
-  SET_TARGET_PROPERTIES(${LAUNCHER_BIN} PROPERTIES COMPILE_FLAGS "-Wall -O2")
+  SET_TARGET_PROPERTIES(${GAME_BIN} PROPERTIES COMPILE_FLAGS "-Wall ${CFLAGS}")
+  SET_TARGET_PROPERTIES(${LAUNCHER_BIN} PROPERTIES COMPILE_FLAGS "-Wall ${CFLAGS}")
 ENDIF(UNIX)
 
 
@@ -248,17 +248,12 @@ SET_TARGET_PROPERTIES(${LAUNCHER_BIN} PROPERTIES PROJE
 
 # Installing on *nix
 IF(UNIX)
-  SET(GAME_INSTALL_DIR "/usr/share/opensonic")
-  SET(GAME_FINAL_DIR "/usr/bin")
+  SET(GAME_INSTALL_DIR "${PREFIX}/share/opensonic")
 
   INSTALL(CODE "MESSAGE(\"Installing Open Sonic ${GAME_VERSION}... Make sure you have root privileges.\")")
   INSTALL(TARGETS ${GAME_BIN} ${LAUNCHER_BIN} RUNTIME DESTINATION ${GAME_INSTALL_DIR})
   INSTALL(FILES license.txt readme.html DESTINATION ${GAME_INSTALL_DIR})
   INSTALL(DIRECTORY config gui images levels licenses musics quests samples screenshots themes languages DESTINATION ${GAME_INSTALL_DIR} PATTERN ".svn" EXCLUDE)
-
-  INSTALL(CODE "MESSAGE(\"Creating files at ${GAME_FINAL_DIR}...\")")
-  INSTALL(CODE "EXECUTE_PROCESS(COMMAND \"cmake\" \"-E\" \"copy\" \"${GAME_INSTALL_DIR}/${GAME_BIN}\" \"${GAME_FINAL_DIR}/${GAME_BIN}\")")
-  INSTALL(CODE "EXECUTE_PROCESS(COMMAND \"cmake\" \"-E\" \"copy\" \"${GAME_INSTALL_DIR}/${LAUNCHER_BIN}\" \"${GAME_FINAL_DIR}/${LAUNCHER_BIN}\")")
 
   INSTALL(CODE "MESSAGE(\"Done! Run ${LAUNCHER_BIN} to start the game.\")")
 ENDIF(UNIX)
